package core;
import java.util.*;

/**
 * Chemical Entity is an abstract class that generalizes the Specie and
 * Component classes.
 * 
 * @author Charlie Moore
 */
abstract class ChemicalEntity extends Observable {
    /**
     * Name of this entity (e.g.&nbsp;CO<sub>2</sub>)
     */
    private String name;

    /**
     * Charge of this entity (e.g.&nbsp;-2)
     */
    private int charge;
    
    /**
     * Ionic radius for ionic strength calculations
     */
    private double ionSize;
    
    /**
     * Molarity at equilibrium
     */
    private double conc;
    
    /**
     * Standard deviation in the calculated total
     */
    private double stdDev;
    
    //=================================
    // Getters and Setters
    //---------------------------------
    
    public String getName() { return name; }
    public void   setName(String newName) {
        name = newName;
        setChanged();
        notifyObservers();
    }
    
    public int  getCharge() { return charge; }
    public void setCharge(int newCharge) {
        charge = newCharge;
        setChanged();
        notifyObservers();
    }
    
    public double getIonSize() { return ionSize; }
    public void   setIonSize(double newIonSize) {
        ionSize = newIonSize;
        setChanged();
        notifyObservers();
    }
    
    public double getConc() { return conc; }
    public void   setConc(double newConc) {
        conc = newConc;
        setChanged();
        notifyObservers();
    }
    
    public double getStdDev() { return stdDev; }
    public void   setStdDev(double newStdDev) {
        stdDev = newStdDev;
        setChanged();
        notifyObservers();
    }
}
